1. Field of the Invention
The present invention relates to a system for efficiently accessing a database by executing an input program that accesses the database after analysis. In particular, the present invention relates to a system for improving the efficiency of access to a database when such a program including iterative processing is executed.
2. Description of the Related Art
With the recent spread of Java2 Enterprise Edition (J2EE), Java Database Connectivity (JDBC), and the like, access to databases by executing programs written in, for example, the Java (trademark of Sun Microsystems, Inc) language have been enabled. For example, a program that accesses a database is executed in an application server apparatus. The program reads necessary data from the database, determines the condition, and updates the database on the basis of the result of the determination. When an enormous amount of data is processed, a method is used in which iterative processing is described in a program and multiple pieces of data included in a database are sequentially processed.
Such iterative processing is called batch processing. When a database is accessed every time iterative processing is performed in batch processing, the number of accesses to the database may become very large, and thus the efficiency of processing may be decreased. On the other hand, in some types of batch processing, data to be accessed can be statically analyzed prior to processing the data. In these cases, it is preferable that an application server apparatus read in advance data necessary for iterative processing from a database all at once prior to starting iterative processing. A technique for semi-automatically improving the efficiency of batch processing is proposed as a related art (see Non-Patent Document 1).
[Non-Patent Document 1] Jouhou Shori Gakkai Ronbun Shi Vol. 35, No. 5, May 1994.
3. Problems to be Solved by the Invention
However, in some types of batch processing, data to be accessed is determined in the process of iterative processing. For example, when a row has been read from a table for the first time when the iterative processing is performed, another row to be read may be determined by an identification number included in the first row. In this case, data to be accessed in the second query cannot be known prior to performing the first query. Thus, data necessary for iterative processing cannot be read in advance prior to starting iterative processing. Accordingly, a database is accessed every time iterative processing is performed, so that the efficiency of execution of a program may be decreased.
An object of the foregoing related art is to improve the efficiency of the process of sending and receiving data between a plurality of jobs or job steps as to the jobs or the job steps included in batch processing. On the other hand, a plurality of inefficient accesses may occur in a single job. This art is not applicable to this case.
Accordingly, it is an object of the present invention to provide a system, a method, and a control program that provides solutions to the foregoing problems. This object can be achieved by combinations of features described in independent claims in the claims. Dependent claims define further advantageous concrete examples of the present invention.